package lesson;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

import java.io.IOException;
import java.util.Arrays;
import java.util.Set;

public class JsonToa {
    public static void main(String[] args) throws IOException {
        Document document = Jsoup.connect("http://127.0.0.1:8848/jsoup/finddom.html").get();
        Element toBaidu = document.getElementById("toBaidu");
        //获取标签名称
        System.out.println(toBaidu.tagName());
        //获取类
        System.out.println(toBaidu.className());
        //System.out.println(Arrays.toString(toBaidu.classNames()));
        Set<String> classNames = toBaidu.classNames();
        for(String str:classNames){
            System.out.println(str);
        }
        //获取属性
        //获取文本
        System.out.println(toBaidu.html());

    }
}
